<template>
  <div class="see">
    <ul>
      <li>
        <label>名称：</label>
        <span>{{rowData.dictTypeName}}</span>
      </li>
      <li>
        <label>类型：</label>
        <span>{{dicName(rowData.mdType)}}</span>
      </li>

      <li>
        <label>编码：</label>
        <span>{{rowData.mdCode}}</span>
      </li>
      <li>
        <label>长度：</label>
        <span>{{rowData.mdLength}}</span>
      </li>

      <li>
        <label>主键：</label>
        <span>{{rowData.id}}</span>
      </li>
      <li>
        <label>为空：</label>
        <span><el-switch v-model="rowData.isNull" disabled></el-switch></span>
      </li>

      <li>
        <label>可查询：</label>
        <span><el-switch v-model="rowData.isQuery" disabled></el-switch></span>
      </li>
      <li>
        <label>可序列：</label>
        <span><el-switch v-model="rowData.isQuickQuery" disabled></el-switch></span>
      </li>

      <li>
        <label>自增：</label>
        <span><el-switch v-model="rowData.isAutoIncrement" disabled></el-switch></span>
      </li>
      <li>
        <label>继承：</label>
        <span><el-switch v-model="rowData.isExtend" disabled></el-switch></span>
      </li>
    </ul>
  </div>
</template>

<script>
import { getSysDicId } from '../../../../../api/dictionary/dictionary'

export default {
  name: 'seeDetail',
  props: {
    rowData: {
      type: Object,
      default: () => ({})
    }
  },
  data () {
    return {
      dicData: []
    }
  },
  mounted () {
    this.getDicData()
  },
  methods: {
    getDicData () {
      getSysDicId('metadata_type').then(res => {
        this.dicData = res.data.data
      })
    },
    dicName (val) {
      let name = ''
      // 匹配中文
      this.dicData.map(item => {
        if (item.dictValue === val) {
          name = item.dictLabel
        }
      })
      return name
    }
  }
}
</script>

<style lang="scss" scoped>
.see{
  margin-top: -20px;
  ul{
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    li{
      width: 50%;
      line-height: 40px;
      label{
        font-size: 16px;
        color: #333;
        text-align: right;
        width: 100px;
        display: inline-block;
      }
      span{
        font-size: 14px;
        color: #666;
      }
    }
  }
}
</style>
